<extend name="Public/base" />

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>

<block name="body">
    
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-globe"></i>草稿箱({:count($list)})</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <button class="btn green ajax-post confirm" target-form="ids" url="{:U("Article/setStatus",array("status"=>-1))}">删 除</button>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
								<th class="">编号</th>
								<th class="">标题</th>
								<th class="">类型</th>
								<th class="">分类</th>
								<th class="">最后更新</th>
								<th class="">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        	<volist name="list" id="vo">
                            <tr class="odd gradeX">                 
					            <td><input class="checkboxes ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
								<td>{$vo.id} </td>
								<td><a data-id="{$vo.id}" href="{:U('Article/edit?cate_id='.$vo['category_id'].'&id='.$vo['id'])}">{$vo.title}</a></td>
								<td>{:get_document_type($vo['type'])}</td>
								<td><span>{:get_cate($vo['category_id'])}</span></td>
								<td><span>{$vo.update_time|time_format}</span></td>
								<td><a href="{:U('Article/edit?cate_id='.$vo['category_id'].'&id='.$vo['id'])}">编辑</a>
									<a href="{:U('Article/setstatus?ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
									<a href="{:U('Article/setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">删除</a>
					                </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                    <div class="page">
                        {$_page}
                    </div>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
		   App.init();
		   TableManaged.init();
		});
	</script>
</block>